package com.ruoyi.web.shopping.service.impl;

import com.ruoyi.web.shopping.entity.Discounts;
import com.ruoyi.web.shopping.entity.Prices;
import com.ruoyi.web.shopping.mapper.DiscountsMapper;
import com.ruoyi.web.shopping.mapper.PricesMapper;
import com.ruoyi.web.shopping.service.DiscountsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DiscountsImpl implements DiscountsService {
    @Autowired
    private DiscountsMapper discountsMapper;

    /**
     * 查询折扣
     *
     * @param id
     * @return
     */
    public Discounts selectById(String id) {
        Discounts discounts = discountsMapper.selectById(id);
        return discounts;
    }

    /**
     * 修改折扣
     *
     * @param discounts
     */
    public void update(Discounts discounts) {
        discountsMapper.update(discounts);
    }

    /**
     * 删除折扣
     *
     * @param id
     */
    public void deleteById(String id) {
        discountsMapper.deleteById(id);
    }

    /**
     * 新增折扣
     * @param discounts
     */
    public void save(Discounts discounts) {
        discountsMapper.save(discounts);
    }
}
